//
//  ServiceNews.h
//  suRead
//
//  Created by lidi on 15/11/6.
//  Copyright © 2015年 bao. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ServiceUtils.h"

typedef enum {
    RequestType_Refresh = 1,
    RequestType_LoadMore = 2
}RequestType;


//APP打开图片
static NSString *url_appopen_image = @"http://www3.ctdsb.net/index.php?m=app&c=wakeup&a=wakeup";

//新闻搜索
static NSString *url_net_search_news = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=search";


//搜索关键字列表
static NSString *url_net_search_keywords = @"http://www3.ctdsb.net/index.php?m=app&c=n_index&a=keywordlist";

//  //版权申明
static NSString *url_net_Copyright = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=get_news&type=doc&aid=304";

//关于
static NSString *url_net_about = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=get_news&type=doc&aid=306";


//默认分页大小
static NSInteger DEFAULT_PAGE_SIZE = 15;

//图秀
static NSString *URL_SUB_PHOTO_SHOW = @"index.php?m=app&c=index&a=list_newsz&catid=32";

//掌报
static NSString *URL_SUB_POCKTE_NEWS = @"index.php?m=app&c=index&a=get_news&type=doc&aid=305";

static NSString *URL_SUB_POCKTE_NEWS_URL = @"http://epaper.ctdsb.net/dsbcyb/html/%@/node_2.htm";

//服务
static NSString *URL_SUB_SERVING = @"html/2015/other/serve.html";

//互动
static NSString *URL_SUB_INTERACTIVE = @"index.php?m=app&c=index&a=list_newsz&catid=11";

//报料列表
static NSString *URL_SUB_REPORT_LIST = @"http://www3.ctdsb.net/index.php?m=app&c=baoliao&a=getlist1";

//报料
static NSString *URL_SUB_REPORT = @"index.php?m=app&c=baoliao&a=post";

//获取报料内容
static NSString *URL_SUB_REPORT_DETAIL = @"http://www3.ctdsb.net/index.php?m=app&c=baoliao&a=get_baoliao";

//发表评论
static NSString *URL_SUB_POST_COMMENT = @"index.php?m=app&c=comment&a=post_comment";

//获取个人评论列表
static NSString *URL_SUB_GET_MY_COMMENT = @"index.php?m=app&c=comment&a=get_user_comments";

//获取广告
static NSString *URL_SUB_GET_AD = @"http://www3.ctdsb.net/index.php?m=app&c=other&a=startimgs";

//获取tags
static NSString *URL_SUB_GET_TAGS = @"http://www3.ctdsb.net/index.php?m=app&c=fuli&a=get_categorys";

//阅读数发送
static NSString *URL_SUB_READ = @"http://www3.ctdsb.net/api.php?op=count&modelid=1";

//站内私信
static NSString *URL_SUB_GET_PRIVATE_LETTER = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=get_announce";

//报料点赞
static NSString *URL_SUB_ZAN_BAOLIAO = @"http://www3.ctdsb.net/index.php?m=app&c=baoliao&a=baoliaospport";

//文章点赞
static NSString *URL_SUB_ZAN_NEWS= @"http://www3.ctdsb.net/index.php?m=app&c=index&a=artspport";

//评论点赞
static NSString *URL_SUB_ZAN_COMMENT = @"http://www3.ctdsb.net/index.php?m=app&c=comment&a=supports";
//评论回复
static NSString *URL_SUB_REPLY_COMMENT= @"http://www3.ctdsb.net/index.php?m=app&c=comment&a=post_comment";

//记者回音列表接口
static NSString *URL_SUB_GET_NEWSMAN_REPLY= @"http://www3.ctdsb.net/index.php?m=app&c=baoliao&a=getreply";
//记者回音详情
static NSString *URL_SUB_GET_NEWSMAN_REPLY_DETAIL= @"http://www3.ctdsb.net/index.php?m=app&c=baoliao&a=get_content";

//获取IP
//static NSString *URL_SUB_GET_IP= @"http://ip.chinaz.com/getip.aspx";
static NSString *URL_SUB_GET_IP = @"http://pv.sohu.com/cityjson?ie=utf-8";

//新闻详情地址
static NSString *URL_SUB_GET_NEWS_DETAIL= @"http://www3.ctdsb.net/index.php?m=app&c=index&a=get_news&type=doc";

//专题地址拼接
static NSString *URL_SUB_GET_SPECIAL_NEWS = @"http://www3.ctdsb.net/index.php?m=app&c=index&a=get_special_news";

//问吧提交问题
static NSString *URL_SUB_POST_QUESTION = @"http://g.ctdsb.net/index.php?m=app&c=wenba&a=ask_questions";

//问吧提交问题
static NSString *URL_SUB_POST_QUESTION_COMMENT =@"http://g.ctdsb.net/index.php?m=app&c=wenba_comment&a=post_comment";

//问吧点赞
static NSString *URL_SUB_POST_QUESTION_ZAN =@"http://g.ctdsb.net/index.php?m=app&c=wenba&a=support";

//查询用户标签
static NSString *URL_SUB_FETCH_USER_TAGS = @"http://www3.ctdsb.net/index.php?m=app&c=subscribe&a=subscribe_list";

// 位置新闻
static NSString *url_fetch_location_news = @"http://www3.ctdsb.net/index.php?m=content&c=positiondata&a=getPosition&posid=%@";

@interface ServiceNews : NSObject



/**
 *  APP打开宣传图片接口
 *
 *  @param suburl_ 请求url
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchAppOpenImage:(NSString *)suburl_
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;


/**
 *  新闻搜索
 *
 *  @param keyword_ 搜索关键字
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doSearchNewsList:(NSString *)keyword_
                                pageindex:(NSInteger)pageindex_
                                 pagesize:(NSInteger)pagesize_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  直播界面热门新闻
 *
 *  @param suburl_ 请求url
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doHotNewsList:(NSString *)suburl_
                                 pageindex:(NSInteger)pageindex_
                                  pagesize:(NSInteger)pagesize_
                                   success:(void (^)(id responseObject,NSString *message))success_
                                   failure:(void (^)(NSString *message))failure_;


/**
 *  直播新闻详情
 *
 *  @param suburl_ 请求url
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doPlayNewsDetail:(NSString *)suburl_
                              lid:(NSString *)lid_
                               type:(NSString *)type_
                                success:(void (^)(id responseObject,NSString *message))success_
                                failure:(void (^)(NSString *message))failure_;

/**
 * 直播热词
 *
 *
 */
+ (NSURLSessionDataTask *)doPlayHotWords:(NSString *)suburl_
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;
/**
 *  搜索关键字列表
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchKeywords:(void (^)(id responseObject,NSString *message))success_
                              failure:(void (^)(NSString *message))failure_;

/**
 *  阅读数发送
 *
 *  @param id_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doSendRead:(NSString *)id_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  获取tags
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchTags:(void (^)(id responseObject,NSString *message))success_
                              failure:(void (^)(NSString *message))failure_;

/**
 *  获取新闻列表
 *
 *  @param type_    1 刷新  2 加载更多
 *  @param subURL_  子链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchNewsList:(RequestType)type_
                                   subURL:(NSString *)subURL_
                                pageIndex:(NSInteger)pageIndex_
                                 pageSize:(NSInteger)pageSize_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;
/**
 *  获取首页焦点图列表
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchHomeFocusList:(void (^)(id responseObject,NSString *message))success_
                                       failure:(void (^)(NSString *message))failure_;

/**
 *  获取"专题"新闻列表
 *
 *  @param subURL_  子链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchSpecialNewsList:(NSString *)subURL_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  获取"问吧专题"新闻列表
 *
 *  @param subURL_  子链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchWenBaCtgNewsList:(NSString *)subURL_
                                         pageIndex:(NSInteger)pageIndex_
                                         pageSize:(NSInteger)pageSize_
                                         success:(void (^)(id responseObject,NSString *message))success_
                                         failure:(void (^)(NSString *message))failure_;

/**
 *  获取新闻详情
 *
 *  @param urlString_ 请求链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchNewsDetail:(NSString *)urlString_
                                    success:(void (^)(id responseObject,NSString *message))success_
                                    failure:(void (^)(NSString *message))failure_;

/**
 *  获取问吧详情
 *
 *  @param urlString_ 请求链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchWenBaDetail:(NSString *)urlString_
                                    success:(void (^)(id responseObject,NSString *message))success_
                                    failure:(void (^)(NSString *message))failure_;

/**
 *  图秀列表
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchPhotoShowList:(void (^)(id responseObject,NSString *message))success_
                                       failure:(void (^)(NSString *message))failure_;

/**
 *  掌报
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchPocketNewsURL:(void (^)(id responseObject,NSString *message))success_
                                       failure:(void (^)(NSString *message))failure_;

/**
 *  互动列表
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchInteractiveList:(NSInteger)pageIndex_
                                        pageSize:(NSInteger)pageSize_
                                         success:(void (^)(id responseObject,NSString *message))success_
                                         failure:(void (^)(NSString *message))failure_;

/**
 *  报料列表
 *
 *  @param pageIndex_
 *  @param pageSize_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchReportList:(NSInteger)pageIndex_
                                   pageSize:(NSInteger)pageSize_
                                    success:(void (^)(id responseObject,NSString *message))success_
                                    failure:(void (^)(NSString *message))failure_;

/**
 *  注册
 *
 *  @param username_
 *  @param nickname_
 *  @param email_
 *  @param mobile_
 *  @param password_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doRegister:(NSString *)username_
                            nickname:(NSString *)nickname_
                               email:(NSString *)email_
                              mobile:(NSString *)mobile_
                            password:(NSString *)password_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  登录
 *
 *  @param username_
 *  @param password_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doLogin:(NSString *)username_
                            password:(NSString *)password_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  第三方登录
 *
 *  @param username_
 *  @param openid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doLoginByThirdPart:(NSString *)username_
                         openid:(NSString *)openid_
                          success:(void (^)(id responseObject,NSString *message))success_
                          failure:(void (^)(NSString *message))failure_;

/**
 *  图片上传
 *
 *  @param imageFilePath_ 图片本地地址
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionUploadTask *)doUpdatePhotoList:(NSString *)imageFilePath_
                                      success:(void (^)(id responseObject,NSString *message))success_
                                      failure:(void (^)(NSString *message))failure_;

/**
 *  报料发布
 *
 *  @param title_
 *  @param content_
 *  @param imgs_
 *  @param contact_
 *  @param username_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doReport:(NSString *)title_
                           content:(NSString *)content_
                              imgs:(NSString *)imgs_
                           contact:(NSString *)contact_
                          username:(NSString *)username_
                          ispublic:(BOOL)ispublic_
                           success:(void (^)(id responseObject,NSString *message))success_
                           failure:(void (^)(NSString *message))failure_;

/**
 *  反馈
 *
 *  @param content_
 *  @param username_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFeedBack:(NSString *)content_
                            username:(NSString *)username_
                             success:(void (^)(id responseObject,NSString *message))success_
                             failure:(void (^)(NSString *message))failure_;

/**
 *  报料内容
 *
 *  @param baoliaoid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doReportDetail:(NSString *)baoliaoid_
                           success:(void (^)(id responseObject,NSString *message))success_
                           failure:(void (^)(NSString *message))failure_;

/**
 *  获取新闻评论
 *
 *  @param urlString_ 请求链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchNewsComment:(NSString *)urlString_
                                    success:(void (^)(id responseObject,NSString *message))success_
                                    failure:(void (^)(NSString *message))failure_;

/**
 *  关于我们
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchAboutUs:(void (^)(id responseObject,NSString *message))success_
                                       failure:(void (^)(NSString *message))failure_;

/**
 *  免责声明
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchCopyright:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;

/**
 *  发表评论
 *
 *  @param commentid_ 评论id
 *  @param id_        如果是评论回复这个id_就有值
 *  @param content_   评论内容
 *  @param userid_    用户id
 *  @param username_  用户昵称
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doNewsSendComments:(NSString *)commentid_
                                       andId:(NSString *)id_
                                     content:(NSString *)content_
                                      userid:(NSString *)userid_
                                    username:(NSString *)username_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  获取我的个人评论
 *
 *  @param userid_    我的用户id
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchMyComments:(NSString *)userid_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  获取广告
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchAD:(void (^)(id responseObject,NSString *message))success_
                                       failure:(void (^)(NSString *message))failure_;

/**
 *  获取站内私信
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchPrivateLetter:(void (^)(id responseObject,NSString *message))success_
                            failure:(void (^)(NSString *message))failure_;


/**
 *  报料点赞
 *
 *  @param baoliaoid_ 报料id
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doZanBaoLiao:(NSString *)baoliaoid_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  文章点赞
 *
 *  @param catid_ 频道ID
 *  @param aid_ 文章id
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doZanNews:(NSString *)catid_
                               aid:(NSString *)aid_
                               success:(void (^)(id responseObject,NSString *message))success_
                               failure:(void (^)(NSString *message))failure_;

/**
 *  评论点赞
 *
 *  @param commentid_ 评论文章的ID
 *  @param Id_   ID
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doZanComments:(NSString *)commentid_
                                     andId:(NSString *)Id_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  评论回复
 *
 *  @param commentid_ 评论文章的ID
 *  @param Id_   ID
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doReplyComments:(NSString *)commentid_
                                    andId:(NSString *)Id_
                                  content:(NSString *)content_
                                   userid:(NSString *)userid_
                                 username:(NSString *)username_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  获取记者回音
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */

+ (NSURLSessionDataTask *)doFetchNewsManReplyList:(NSInteger)pageIndex_
                                         pageSize:(NSInteger)pageSize_
                                          success:(void (^)(id responseObject,NSString *message))success_
                                          failure:(void (^)(NSString *message))failure_;

/**
 *  记者回音详情
 *
 *  @param baoliaoid_
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchNewsManReplyDetail:(NSString *)baoliaoid_
                                  success:(void (^)(id responseObject,NSString *message))success_
                                  failure:(void (^)(NSString *message))failure_;

/**
 *  获取我的ip
 *
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchMyIp:(void (^)(id responseObject,NSString *message))success_
                                          failure:(void (^)(NSString *message))failure_;
/**
 *  @brief 获取AuthCode
 *
 *  @return 用户认证码格式，请改为　“20“加上时间加上三个随机数，加上001.
 */
+ (NSString *)getAuthCode;

/**
 *  发表提问
 *
 *  @param zhuanjia_id 专家id
 *  @param content_   提问内容
 *  @param userid_    用户id
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doQuestionSend:(NSString *)zhuanjia_id
                                     content:(NSString *)content_
                                      userid:(NSString *)userid_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  发表问题评论
 *
 *  @param zhuanjia_id 专家id
 *  @param content_   提问内容
 *  @param userid_    用户id
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doQuestionCommentSend:(NSString *)wbreplyid_
                                 content:(NSString *)content_
                                  userid:(NSString *)userid_
                                    type:(NSString *)type_
                               commentid:(NSString *)commentid_
                                 success:(void (^)(id responseObject,NSString *message))success_
                                 failure:(void (^)(NSString *message))failure_;



/**
 *  获取问吧问题评论
 *
 *  @param urlString_ 请求链接
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doFetchQuestionComments:(NSString *)urlString_
                                     success:(void (^)(id responseObject,NSString *message))success_
                                     failure:(void (^)(NSString *message))failure_;

/**
 *  问吧点赞
 *
 *  @param id_ ID
 *  @param type_ 专家/评论
 *  @param success_
 *  @param failure_
 *
 *  @return
 */
+ (NSURLSessionDataTask *)doZanQuestion:(NSString *)id_
                                type:(NSString *)type_
                            success:(void (^)(id responseObject,NSString *message))success_
                            failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doFetchLocationNews:(NSString *)posid
                                    pageindex:(NSInteger)pageindex_
                                     pagesize:(NSInteger)pagesize_
                                      success:(void (^)(id responseObject,NSString *message))success_
                                      failure:(void (^)(NSString *message))failure_;

+ (NSURLSessionDataTask *)doFetchMoreNews:(NSInteger)pageindex_
                                     pagesize:(NSInteger)pagesize_
                                      success:(void (^)(id responseObject,NSString *message))success_
                                      failure:(void (^)(NSString *message))failure_;
@end
